// 样式文件
import '@assets/styles/main.scss';
// 脚本文件
import '@components/Header'

// import '@components/home'





import dianming from '@components/home.html'
import tabs from '@components/tabs/tab.html'

import Home1 from '@components/home1';
import Home2 from '@components/home2';
import Home3 from '@components/home3';
import { tabsjs } from '@components/tabs/tabjs';

document.addEventListener('DOMContentLoaded', async () => {

    // 获取 当前url 的hash值
    const currentHash = window.location.hash.slice(1);
    console.log(currentHash);



    // 获取 id为app div
    const appEle = document.querySelector('#app') as HTMLDivElement
    console.log(appEle);

    if (appEle) {
        if (currentHash === 'home') {
            appEle.innerHTML = `${dianming}`

            let home1 = new Home1()
            home1.init()

            let home2 = new Home2()
            home2.addEventLister()

            let home3 = new Home3()
            home3.addEventListener()

        } else if (currentHash === 'tabs') {
            appEle.innerHTML = `${tabs}`
            // appEle.innerHTML = ((await import('@components/tabs/tab.html')).default)
            tabsjs()

        }
    }


})





// console.log('Hello, Webpack + TypeScript + SCSS!');
